package com.blobfish.fiction.common.base.exception;

import com.blobfish.fiction.common.base.knowledge.IMessageEnum;

/**
 * 异常信息
 *
 * @author huangbo
 */
public class GlobalErrorException extends BaseErrorException {
    private IMessageEnum messageEnum;
    private Object[] args;

    protected GlobalErrorException() {
    }

    public GlobalErrorException(IMessageEnum messageEnum, Object[] args) {
        super(messageEnum.getMessage());
        this.args = args;
        this.messageEnum = messageEnum;
    }

    public GlobalErrorException(IMessageEnum messageEnum) {
        this(messageEnum, (Object[]) null);
    }

    @Override
    public String getId() {
        return this.messageEnum.getId();
    }

    @Override
    public Object[] getArgs() {
        return this.args;
    }
}
